' tool.bmx

Strict

Import MaxGUI.MaxGUI
Import BRL.EventQueue

Type TTool
	Field propertybag:TMap

	Method Invoke(command$,argument:Object=Null)
	End Method
	
	Method Process$(commands$)
		Return commands
	End Method
	
	Method GetProperty:Object(key:Object)
		If propertybag Return propertybag.ValueForKey(key)
	End Method

	Method GetStringProperty$(key:Object)
		If propertybag Return String(propertybag.ValueForKey(key))
	End Method

	Method SetProperty:Object(key:Object,property:Object)
		Local old:Object
		old=GetProperty(key)
		If Not propertybag propertybag=New TMap
		propertybag.Insert(key,property)
		Return old
	End Method
End Type
